<?php
if(!defined('BASEPATH')) {
	exit('No direct script access allowed');
}

class search_model extends CI_Model {
	function __construct() {
		parent::__construct();
	}
	/**
	 *查询所有的个人
	 *@param $key 要查询的关键字
	 */
	function listPersonsByKey($key) {
		$sql = "select eu.*, CASE WHEN eu.userBigIcon IS NULL THEN 'images/default/default.gif' ELSE eu.userBigIcon END AS userBigIconCopy from wanwan_enum_user eu where nickName like '%$key%' ";
		$rs = $this->db->query($sql);
		return $rs->result_array();
	}
	/**
	 *查询所有的团队
	 *@param $key 要查询的关键字
	 */
	function listTeamsByKey($key) {
		$sql = "select et.*, CASE WHEN et.teamIcon IS NULL THEN 'images/default/default.gif' ELSE et.teamIcon END AS teamIconCopy from wanwan_enum_team et where teamName like '%$key%'";
		$rs = $this->db->query($sql);
		return $rs->result_array();
	}
}

?>